<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    let n1, n2 = 123,  n3 =null,  n4 =true, n5 = 'hello', n6 ='',  n7 =0;
    console.log(Boolean(n1));  //将未定义 转为布尔型
    console.log(Boolean(n2));  //非0数值 转为布尔型
    console.log(Boolean(n3));   //null 转为布尔型
    console.log(Boolean(n4));    //   转为布尔型
    console.log(Boolean(n5));    //非空字符串 转为布尔型
    console.log(Boolean(n6));    // 空字符串 转为布尔型
    console.log(Boolean(n7));    // 0 转为布尔型
    //未定义 ， 非0数字 ，null , 空字符串 ， 0,转为布尔型结果为false
    //非0数值和非空字符串转为布尔为 tuer

    console.log('--------');
    console.log(Number(n6));
    console.log(parseInt(n6));
    console.log(parseFloat(n6));

    let num =parseInt(n6);
    console.log(num);
    console.log(typeof(num));
    console.log(Boolean(n6)); 

</script>
</html>